A dispersed computing standard that assists the users is cloud computing. In this model, users pay as much as use. Cloud servers try to achieve high performance, and one of the main factors is optimal scheduling. Several metaheuristic techniques are used to solve the scheduling problem, which is an NP-hard problem. In this paper, for task scheduling in the cloud, we use Particle Swarm Optimization (PSO), Firefly Algorithm (FA), Bat Algorithm (BA), and Grasshopper Optimization Algorithm (GOA), which are swarm-based algorithms. All of these algorithms have one or more parameters that can be updated adaptively. We update these parameters using Chaos and compare their performance. The experimental results indicate that the improved GOA can optimize task scheduling problem by effective utilization of available resources.